﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UpdateTeacher.aspx.cs" Inherits="UpdateTeacher" Title="Untitled Page" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title> 修改教师信息</title>
   <link href="../Css/ys.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="../My97DatePicker/WdatePicker.js"></script>
       <script language="javascript" src="../Js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript">

        function caculate_length()   //检测剩余可输入字符数    
        {
            var ShortCommodityName = $("#Txtdesc").val();
            var Ennum = 0;
            var Chnum = 0;
            newarry = ShortCommodityName.split("");
            for (i = 0; i < newarry.length; i++) {
                if (ischinese(newarry[i])) {
                    Chnum = parseInt(Chnum) + 2;
                }
                else {
                    Ennum = parseInt(Ennum) + 1;
                }
            }
            var text_length = Chnum + Ennum;
            var text_max_length = 200;
            var target_div = document.getElementById("fontNum");
            var text_remain = text_max_length - text_length;
            if (text_remain <= 0) {
                var charsum = Chnum / 2 + Ennum - 1;
                var text_remainstr = $("#Txtdesc").val().substring(charsum, 140);
                $("#Txtdesc").val($("#Txtdesc").val().replace(text_remainstr, ''));
                text_remain = 0;
            }
            target_div.innerHTML = "<font   color=#ff0000>" + text_remain + "</font>";
        }

        function ischinese(strword) {
            var newPar = /[^\u4E00-\u9FA5]/g
            return !newPar.test(strword);
        }

    </script>
</head>
<body>
     <form id="form1" runat="server">
    <div class="zt mainCenter">
        <div class="contentBody">
            <div class="title">
               教师管理-->修改教师信息</div>
            <table style="width:100%;color:#336699;"  class="ta1">
        <tr><td class="ta2 tag" > 真实名:</td>
        <td class="ta2">
            <asp:TextBox ID="realname" runat="server" CssClass="inp1"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" Text="*"  ControlToValidate="realname"
                 ErrorMessage="用户名不能为空" ValidationGroup="register"></asp:RequiredFieldValidator><label id ="Label1" style ="color:Red; font-size:small"></label></td></tr>
        <tr>
            <td class="ta2 tag" >
                电子邮件：</td>
            <td class="ta2">
                <asp:TextBox ID="txtemail" runat="server" ValidationGroup="register" CssClass="inp1"></asp:TextBox>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" 
                 ControlToValidate="txtemail" runat="server" ErrorMessage="邮箱地址不正确" 
                 ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="register" Width="7px">*</asp:RegularExpressionValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" Text="*"  ControlToValidate="txtemail" 
                ErrorMessage="电子邮件不能为空" ValidationGroup="register"></asp:RequiredFieldValidator>
                </td>
        </tr>
        <tr>
            <td class="ta2 tag" >
                联系方式：</td>
            <td class="ta2">
                <asp:TextBox ID="txttelephone" runat="server" ValidationGroup="register" CssClass="inp1"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" Text="*"  ControlToValidate="txttelephone" 
                ErrorMessage="联系方式不能为空" ValidationGroup="register"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID ="adfas" runat ="server" ErrorMessage ="联系格式不正确" ControlToValidate ="txttelephone" 
                 ValidationExpression ="^((\(\d{3,4}\)|\d{3,4}-)?\d{8})$|^(\d{11})$" Text ="*" ValidationGroup="register"></asp:RegularExpressionValidator>
                    
                </td>
        </tr>
       <tr>
       <td class="ta2 tag" >所属学校</td>
       <td class="ta2">
           <asp:DropDownList ID="dlschool" runat="server" DataTextField="VS_name" 
               DataValueField="ID" Width="120px">
           </asp:DropDownList>
       </td>
       </tr>
                <tr>
                    <td class="ta2 tag">启用</td><td class="ta2">
                            <asp:CheckBox ID="chkIsEnable" runat="server" Checked="true" />
                            </td>
                </tr>
                <tr>
	<td class="ta2 tag"  >
		教师照片：</td>
	<td class="ta2">
        <asp:FileUpload ID="fuTeacherImage" runat="server"  CssClass="inp1"/>
	</td>
                </tr>
       <tr><td class="ta2 tag"  rowspan="6" >个人信息描述</td><td class="ta2" rowspan="6" >
           <textarea id="Txtdesc"  runat="server"  CssClass="inp3" cols="20" rows="6" onkeyup="caculate_length()"></textarea></td>
           </tr></table>
            <span class="fl">你还剩余<span id='fontNum'>200</span>字可输入</span>
        <asp:Button ID="btnadd" runat="server" Text="修改"  CssClass="button" OnClick="btnRegister_Click" ValidationGroup="register" />&nbsp;&nbsp;<input type="button" onclick="this.form.reset(); " value="重置" class="button"  id="btnReset" runat="server"/>&nbsp;&nbsp;<input type="button" value="返回" onclick="window.history.go(-1)" class="button"  id="back" runat="server" >
        <span id="AuthSpan" style="color:Red;font-size:small" ></span> 
    
    <p style="color:Red; text-align:left"><asp:Label ID="lblMess" runat="server"></asp:Label></p>
   <p style="margin-left:50px">&nbsp;<asp:ValidationSummary ID="validSummary" runat="server"  HeaderText="错误信息" ValidationGroup="register" /> 
   </div>
   </div>
    <asp:HiddenField ID="hidId" runat="server" />
 </form>
</body>
</html>


